package com.chixing.controller;

import com.chixing.service.FavoriteService;
import com.chixing.util.ServerResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.servlet.ModelAndView;

/**
 * @author 马博
 * * @date 2021/10/5
 */
@Controller
public class FavoriteController {
    @Autowired
    private FavoriteService favoriteService;
    //根据主键查询车辆
    @GetMapping("/favorite/{custId}")
    public ModelAndView getCustomerFavoriteCar(@PathVariable("custId") Integer custId){
        ServerResponse serverResponse=favoriteService.getCustomerFavoriteCar(custId);
        ModelAndView mav=new ModelAndView();
        mav.addObject("serverResponse",serverResponse);
        mav.setViewName("customer/favorite");
        return mav;
    }
}
